package com.xcc.annotation.aop.config;

import com.xcc.annotation.aop.log.LogAspects;
import com.xcc.annotation.aop.log.MathCalculator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * 1，@EnableAspectJAutoProxy中@Import(AspectJAutoProxyRegistrar.class)
 *   导入AspectJAutoProxyRegistrar
 *      方法registerBeanDefinitions(..)
 *         采用Registrar注入对象AnnotationAwareAspectJAutoProxyCreator实例
 *           RootBeanDefinition beanDefinition = new RootBeanDefinition(AnnotationAwareAspectJAutoProxyCreator实例)
 *           registry.registerBeanDefinition("...internalAutoProxyCreator", beanDefinition);
 * 2，AnnotationAwareAspectJAutoProxyCreator的具体功能
 *
 *
 */
@EnableAspectJAutoProxy
public class Demo01_Aspect {

    @Bean
    public LogAspects logAspects() {
        return new LogAspects();
    }

    @Bean
    public MathCalculator mathCalculator() {
        return new MathCalculator();
    }

}
